package com.uzai.console.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uzai.console.dto.faq.privatework.FaqKeywordQuery;
import com.uzai.console.entity.FaqKeyword;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface FaqKeywordMapper {
    int deleteById(@Param("id") Long id, @Param("merId") Long merId);

    int insert(FaqKeyword record);

    int insertSelective(FaqKeyword record);

    FaqKeyword selectById(@Param("id") Long id, @Param("merId") Long merId);

    int updateByIdSelective(FaqKeyword record);

    int updateById(FaqKeyword record);

    FaqKeyword getByKeywordAndDeviceUniqueId(@Param("keyword")String keyword, @Param("merId")Long merId, @Param("deviceUniqueId") Long deviceUniqueId, @Param("deviceType") String deviceType);

    void delByReplyId(@Param("replyId")Long replyId, @Param("merId") Long merId);

    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    ArrayList<FaqKeyword> findByList(Page<FaqKeyword> page, @Param("query") FaqKeywordQuery query);

    /**
     * 查询所有
     * @param query
     * @return
     */
    ArrayList<FaqKeyword> findByList(@Param("query") FaqKeywordQuery query);
}